<?php

include dirname(dirname(dirname(__FILE__))) . '/include/common.php';

class webServiceDeleteToDo extends core {

    public function process() {
        $todo_id = intval($_POST['todo_id']);
        $user_id = intval($_POST['user_id']);
       
        $data = $this->db->get_row("SELECT * FROM todo_lists WHERE `todo_id`='$todo_id' AND `user_id`='$user_id'");
        if ($data) {                    
            $this->_JSONResponse(array('error' => 0, 'title' => $data->todo_item,
            'timestamp' => $data->timestamp,
            'start_time' => $data->start_time,
            'end_time' => $data->end_time
            ));
        } else {
            $this->_JSONResponse(array('error' => 1, 'msg' => 'Task does not exist'));
        }
    }

}

$processor = new webServiceDeleteToDo();
$processor->process();
?>